const { StringDecoder } = require('string_decoder');
const decoder = new StringDecoder('utf8');

const cent = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
console.log(1, decoder.write(cent));//就是相当于 buffer.toString();

const euro = Buffer.from('buffer');
console.log(2, decoder.write(euro));